package agenda.datos;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class LeerDatos {

public ArrayList<String> Datos(){
ArrayList<String> datos=new ArrayList<>();

File f = new File("Agenda.txt");
FileReader fr;
try {
fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String linea;
while((linea = br.readLine()) != null)
//System.out.println(linea);
datos.add(linea);
br.close();
} catch(FileNotFoundException e) {
e.printStackTrace();
} catch(IOException e) {
e.printStackTrace();
System.out.println("Leido");
}
return datos;  
    
}
}
